package com.iflytek.sbd.controller;

import com.iflytek.sbd.mapper.db.ComputerMapper;
import com.iflytek.sbd.mybatis.PageResultBean;
import com.iflytek.sbd.po.db.Computer;
import com.iflytek.sbd.service.db.ComputerService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

/**
 * @program: sbd
 * @description:
 * @author: 陈亮
 * @create: 2022-02-27 21:34
 */
@Api(tags = "computerController")
@RestController
@RequestMapping("/computer")
public class ComputerController {


    @Resource
    private ComputerService computerService;
    @Resource
    private ComputerMapper  computerMapper;



    @PostMapping("/saveComputer")
    public void saveComputer(@Validated Computer computer) {
        computerService.saveComputer(computer);
        //computerMapper.existsWithPrimaryKey()
    }

    @GetMapping("/findList")
    public PageResultBean<Computer> findList(){
        return computerService.findList();
    }



}
